package com.badibadi.activity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.badibadi.fragment.ActivityOverViewFragment0;
import com.badibadi.fragment.ConsultingFragment0;
import com.badibadi.fragment.ActivityOverViewFragment0.getFragmentData_1;
import com.badibadi.infos.ClueTypeModel;
import com.badibadi.infos.Consult_Model;
import com.badibadi.infos.Results;
import com.badibadi.infos.discussListModel;
import com.badibadi.infos.personModel;
import com.badibadi.mail.MailFirstSendMailActivity;
import com.badibadi.mytools.Constants;
import com.badibadi.mytools.HtmlUtils;
import com.badibadi.mytools.JSONUtils;
import com.badibadi.mytools.MyThreadTool;
import com.badibadi.mytools.SinaExpressionTools;
import com.badibadi.mytools.TabHostUtils;
import com.badibadi.mytools.Utils;
import com.badibadi.uniclubber.R;
import com.badibadi.uniclubber.SinaExpressionActivity;
import com.badibadi.uniclubber.R.layout;
import com.badibadi.uniclubber.R.menu;
import com.libjph.util.StringUtil;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;
import com.view.my_view.My_XListView;
import com.view.my_view.My_XListView.IXListViewListener_1;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.app.Activity;
import android.content.Intent;
import android.graphics.drawable.BitmapDrawable;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.test.UiThreadTest;
import android.text.Editable;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.RatingBar;
import android.widget.TabHost;
import android.widget.RatingBar.OnRatingBarChangeListener;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;

/**
 * 咨询费的评价界面activity_consulting_evaluation_zhuanye
 * 
 * @author Administrator activity_consulting_evaluation_list
 * 
 */
public class ConsultingActivity extends BaseActivity implements
OnClickListener {

	private FragmentManager manager;
	protected TabHost mTabHost;
	private String cid;
	private Bundle bun;
	private ConsultingFragment0 fragment0;
	private FragmentTransaction transaction;
	private ClueTypeModel clueTypeModel;
	protected TextView over_view_tital;
	private Button over_view_back;
	private Consult_Model consult_Model;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		goToTheTitle();
		setContentView(R.layout.consult_view);
		init(1);
		initTabHost();
		this.findViewById(R.id.return_btn).setOnClickListener(
				new View.OnClickListener() {
					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						finish();
					}
				});
	}
    @Override
    protected void onPause() {
    	super.onPause();
    	ImageLoader.getInstance().clearDiscCache();
    	ImageLoader.getInstance().clearMemoryCache();
    }
	

	protected void init(int t) {
		try {
			
		
		cid = getIntent().getStringExtra("cid");
	
		} catch (Exception e) {
			// TODO: handle exception
		}
		manager = getSupportFragmentManager();
		fragment0 = new ConsultingFragment0();
		transaction = manager.beginTransaction();
		bun = new Bundle();
		bun.putInt("type", t);
		bun.putString("uid", Utils.getUid(ConsultingActivity.this));
		bun.putString("cid", cid);	
		fragment0.setArguments(bun);
		transaction.replace(R.id.consult, fragment0);
		transaction.commit();
	}

	protected void initTabHost() {
		// TODO Auto-generated method stub
		mTabHost = (TabHost) findViewById(R.id.activity_consult_tabhost);
		mTabHost.setup();
		mTabHost.addTab(mTabHost
				.newTabSpec("activity_over_view_tabhost one")
				.setIndicator(getResources().getString(R.string.Newest),
						getResources().getDrawable(R.drawable.ic_launcher))
				.setContent(R.id.tab1));
		mTabHost.addTab(mTabHost
				.newTabSpec("activity_over_view_tabhost two")
				.setIndicator(getResources().getString(R.string.Hottest),
						getResources().getDrawable(R.drawable.ic_launcher))
				.setContent(R.id.tab2));
		mTabHost.addTab(mTabHost
				.newTabSpec("activity_over_view_tabhost three")
				.setIndicator(getResources().getString(R.string.most_luxury),
						getResources().getDrawable(R.drawable.ic_launcher))
				.setContent(R.id.tab3));
		
		TabHostUtils.SetTabHost(this, mTabHost);
		mTabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener() {

			@Override
			public void onTabChanged(String tabId) {
				// TODO Auto-generated method stub
				switch (mTabHost.getCurrentTab()) {
				case 0:
					init(1);
					break;
				case 1:
					init(2);
					break;
				case 2:
					init(3);
					break;
				
				}
			}
		});
	}
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		
	}
	

	

}
